import imp

from . import cache


def main():
    # Read in cache file
    try:
        sig_cache = cache.load('.cb.cache')
    except IOError:
        sig_cache = cache.Cache()

    # Read cbfile in current directory.
    with open('cbfile', 'r') as f:
        m = imp.load_module(
            'cbfile', f, 'cbfile',
            ('', 'r', imp.PY_SOURCE))

    # Execute the setup function in the cbfile. This ultimately loads
    # the entire tree of cbfiles.
    m.setup()

if __name__ == '__main__':
    main()
